import React, { Component } from 'react';
import {
  View,
  Text,
} from 'react-native';
import router from './router';

import Login from './page/Login';
import Home from './page/Home';
import Web from './page/Web';

export default class Com extends Component {
  constructor(props) {
    super(props);
    this.state = {
      route: 'login',
    };
  }

  judge() {
    let com;
    switch (this.props.router) {
      case 'login':
        com = <Login></Login>;
        break;
      case 'home':
        com = <Home></Home>;
        break;
      case 'web':
        com = <Web></Web>;
        break;
      default:
        com = <Text>default</Text>;
        break;
    }
    return com;
  }

  render() {
    let com = this.judge();

    return (com);
  }
}